package com.jt.controller;

import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

//@Slf4j
@RestController
@RefreshScope
public class ProviderLogController {

    private static Logger log = LoggerFactory.getLogger(ProviderLogController.class);

    @Value("${logging.level.com.jt:error}")
    private String logLevel;



    @GetMapping("/provider/log/doLog2")
    public String doLog2() {
        log.info("log level is {}",logLevel);
        return "log level is " + logLevel;
    }

    @GetMapping("/provider/log/doLog1")
    public String doLog1(){
        System.out.println("==doLog01==");
        log.trace("==trace==");
        log.debug("==debug==");
        log.info("==info==");
        log.warn("==warn==");
        log.error("==error==");

        return "log config test";
    }
}
